<?php

namespace app\api\model\mysql;

use app\common\model\TimeModel;

class MallSetting extends TimeModel
{
    /**
     * @param array $name
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getSetting(array $name=[]){
        return $this->field('*')
            ->where([['name','in',$name]])
            ->select()
            ->toArray();
    }

    /**
     * @param string $name
     * @return array|\think\Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getSettingInfo(string $name=''){
        return $this->field('*')
            ->where('name',$name)
            ->find();
    }
}